﻿<UserControl x:Class="TextFileReaderModule.Views.TextFileContentView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:views="clr-namespace:TextFileReaderModule.Views"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:behaviors="clr-namespace:WpfUIUtilities.Behaviors;assembly=WpfUIUtilities"
             x:Name="UserControlRoot"
             mc:Ignorable="d" >
    
    <ListView
        x:Name="TextFileContentViewListView"
        ScrollViewer.IsDeferredScrollingEnabled="True"
        ItemsSource="{Binding ItemsSource, ElementName=UserControlRoot}"
        VirtualizingStackPanel.IsVirtualizing="True"  
        VirtualizingStackPanel.VirtualizationMode="Recycling"
        IsSynchronizedWithCurrentItem="True"
    >
        <i:Interaction.Behaviors>
            <behaviors:PassThroughMouseWheelBehavior />
        </i:Interaction.Behaviors>
        
        <ListView.View>
            <GridView>
                <GridViewColumn Header="Line" Width="50">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding CorrectedId}" />
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>
                <GridViewColumn Header="Content">
                    <GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <views:TextLineView DataContext="{Binding}" />
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>
            </GridView>
        </ListView.View>
    </ListView>

</UserControl>
